package cn.jiyun;

import cn.jiyun.pojo.Users;
import cn.jiyun.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

/**
 * @author Fay
 * @date 2022/6/21&13:06
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringBootMybatisApplication.class)
public class junit {
    @Autowired
    private UserService userService;
    @Test
    public void testSave(){
        Users users = new Users();
        users.setBirth(new Date());
        users.setNam("张三");
        users.setPwd("123");
        users.setSex(0);
        userService.insertUser(users);
    }
}
